vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()
authorMurray McAllister <murray.mcallister@insomniasec.com>
Sat, 25 Mar 2017 03:33:00 +0000 (20:33 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 30 Mar 2017 01:16:33 +0000 (01:16 +0000)
commit663f5e25dd9303417885ae76c87dd094c8b8ca97
tree8dc84bb7003ecbe418636472138cafeca135caa9
parent1c4717120bf373d5f6d2b32fdd2c7734de832b85
vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()

Before memory allocations vmw_surface_define_ioctl() checks the
upper-bounds of a user-supplied size, but does not check if the
supplied size is 0.

Add check to avoid NULL pointer dereferences.

Signed-off-by: Murray McAllister <murray.mcallister@insomniasec.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
[bwh: Fix filename]

Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name vmwgfx-null-pointer-dereference-in-vmw_surface_define_ioctl.patch
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c